<#--
 * Copyright (c) 2010-2011 julewa.com.  
 * All rights reserved. 
 * 
 * @author Huang Benhua
 * @date 2011-2-20
 --><?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE sqlMap PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN" "http://ibatis.apache.org/dtd/sql-map-2.dtd">
<sqlMap namespace="${code}">
	<typeAlias alias="map" type="java.util.Map"/>
	<typeAlias alias="list" type="java.util.List"/>
	<typeAlias alias="set" type="java.util.Set"/>
	<typeAlias alias="string" type="java.lang.String"/>
	<typeAlias alias="${code}" type="${type}"/>
	<resultMap id="${code}Result" class="${code}">
		<#list keys as p>
			<result property="${p.code}" column="${p.dbname}" javaType="${p.typeName}" jdbcType="${p.dbtype}"/>
		</#list>
		<#list columns as p>
			<result property="${p.code}" column="${p.dbname}" javaType="${p.typeName}" jdbcType="${p.dbtype}"/>
		</#list>
	</resultMap>
	<#list maps as m>
	<resultMap id="${m.key}" class="java.util.Map">
		<#list m.value as p>
			<result property="${p[0]}" column="${p[2]}" javaType="${p[1]}" jdbcType="${p[3]}"/>
		</#list>
	</resultMap>
	</#list>
	<#list operations as oper>
		<${oper.value.type} id="${oper.key}" <#if 
			oper.value.resultClass?exists> resultClass="${oper.value.resultClass}" </#if><#if 
			oper.value.resultMap?exists> resultMap="${oper.value.resultMap}" </#if><#if 
			oper.value.paramClass?exists> parameterClass="${oper.value.paramClass}"</#if> >
		<#if oper.composed?exists>
		${oper.value.sql}
		<#else>
		<![CDATA[${oper.value.sql}]]>
		</#if>
		</${oper.value.type}>
	</#list>
	<#list includes as i>
		${i}
	</#list>
</sqlMap>
